﻿@using Step4.Unit4.Models;
@model List<ProductViewModel>
@{
    ViewBag.Title = "商品列表";
    Layout = "_Layout";
}

<h2>商品列表</h2>
@Html.ActionLink("添加商品","Add","Product",new{id=1},htmlAttributes:new{style="color:white",@class="btn btn-primary"})

<table class="table table-hover">
    <thead>
        <tr>
            <th>Id</th>
            <th>商品名称</th>
            <th>商品种类</th>
            <th>价格</th>
            <th>添加人</th>
            <th>最后维护</th>
            <th>最后更新时间</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var p in Model)
        {
            <tr>
                <td>@p.Id</td>
                <td>@p.ProductName</td>
                <td>@p.CategoryName</td>
                <td>@p.Price</td>
                <td>@p.CreatedNickName</td>
                <td>@p.UpdatedNickName</td>
                <td>@p.UpdatedTime</td>
            </tr>
        }
    </tbody>
</table>